

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="老王">
  <meta name="keywords" content="">
  
    <meta name="description" content="window.addEventListener(&#39;DOMContentLoaded&#39;, (event) &#x3D;&gt; {     const codeBlocks &#x3D; document.querySelectorAll(&#39;pre code&#39;);     const maxLines &#x3D; 10; &#x2F;&#x2F; 设置最大行数      codeBlocks.forEach((codeBlock) &#x3D;&gt; {">
<meta property="og:type" content="article">
<meta property="og:title" content="QTL-seq系列 | 使用easyQTLseq进行QTL-seq分析">
<meta property="og:url" content="https://laowang2023.cn/2023/11/07/20231107-easyQTLseq/index.html">
<meta property="og:site_name" content="请叫我老王">
<meta property="og:description" content="window.addEventListener(&#39;DOMContentLoaded&#39;, (event) &#x3D;&gt; {     const codeBlocks &#x3D; document.querySelectorAll(&#39;pre code&#39;);     const maxLines &#x3D; 10; &#x2F;&#x2F; 设置最大行数      codeBlocks.forEach((codeBlock) &#x3D;&gt; {">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://laowang2023.cn/img/index_banner/20230422-QTLseqMethod.png">
<meta property="article:published_time" content="2023-11-07T11:57:53.000Z">
<meta property="article:modified_time" content="2025-11-14T10:24:43.748Z">
<meta property="article:author" content="老王">
<meta property="article:tag" content="R">
<meta property="article:tag" content="QTL-seq">
<meta property="article:tag" content="BSA">
<meta property="article:tag" content="easyQTLseq">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://laowang2023.cn/img/index_banner/20230422-QTLseqMethod.png">
  
  
  
  <title>QTL-seq系列 | 使用easyQTLseq进行QTL-seq分析 - 请叫我老王</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/KaTeX/0.16.2/katex.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"laowang2023.cn","root":"/","version":"1.9.4","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"2gDQrSMhKFxALJaFFpTbgc23-gzGzoHsz","app_key":"NBsdUEdxwrnzaL1XcLReQM4N","server_url":"https://2gdqrsmh.lc-cn-n1-shared.com","path":"window.location.pathname","ignore_local":true}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  

  

  

  

  

  

  

  
    
  



  
<meta name="generator" content="Hexo 5.4.2"><link rel="alternate" href="/atom.xml" title="请叫我老王" type="application/atom+xml">
</head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>请叫我老王</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/atom.xml">
                <i class="iconfont icon-rss-fill"></i>
                <span>订阅</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/index_banner/qtlseq.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="QTL-seq系列 | 使用easyQTLseq进行QTL-seq分析"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-11-07 19:57" pubdate>
          2023年11月7日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          8.9k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          75 分钟
        
      </span>
    

    
    
      
        <span id="leancloud-page-views-container" class="post-meta" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="leancloud-page-views"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">QTL-seq系列 | 使用easyQTLseq进行QTL-seq分析</h1>
            
            
              <div class="markdown-body">
                
                <script>
window.addEventListener('DOMContentLoaded', (event) => {
    const codeBlocks = document.querySelectorAll('pre code');
    const maxLines = 10; // 设置最大行数

    codeBlocks.forEach((codeBlock) => {
        const lines = codeBlock.textContent.split('\n').length;
        if (lines > maxLines) {
            const button = document.createElement('button');
            button.textContent = '显示更多';
            button.classList.add('toggle-button');

            const details = document.createElement('details');
            details.classList.add('code-details');

            const summary = document.createElement('summary');
            summary.textContent = '点击展开/折叠';

            const pre = document.createElement('pre');
            pre.appendChild(codeBlock.cloneNode(true));

            details.appendChild(summary);
            details.appendChild(pre);

            codeBlock.parentNode.replaceChild(details, codeBlock);
            details.parentNode.insertBefore(button, details);
            
            button.addEventListener('click', () => {
                details.open = !details.open;
                button.textContent = details.open ? '显示更少' : '显示更多';
            });
        }
    });
});
</script>
<blockquote>
<p>📌 <strong>更新说明（2025-06-30）</strong><br>
发布 easyQTLseq v1.1.0，新增了以下功能：<br>
新增欧式距离算法阈值，ED<sup>4</sup> 均值加上三倍 ED<sup>4</sup> 的标准差作为阈值，超过该值的区域为显著 QTL。</p>
<p class="katex-block "><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mtext>QTL region</mtext><mo>=</mo><mrow><mo fence="true">{</mo><mi>x</mi><mo>∣</mo><msup><mrow><mi mathvariant="normal">E</mi><mi mathvariant="normal">D</mi></mrow><mn>4</mn></msup><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>&gt;</mo><mover accent="true"><msup><mrow><mi mathvariant="normal">E</mi><mi mathvariant="normal">D</mi></mrow><mn>4</mn></msup><mo stretchy="true">‾</mo></mover><mo>+</mo><mn>3</mn><mo>⋅</mo><mrow><mi mathvariant="normal">V</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow><mo stretchy="false">(</mo><msup><mrow><mi mathvariant="normal">E</mi><mi mathvariant="normal">D</mi></mrow><mn>4</mn></msup><mo stretchy="false">)</mo><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\text{QTL region} = \left\{ x \mid \mathrm{ED}^4(x) &gt; \overline{\mathrm{ED}^4} + 3 \cdot \mathrm{Var}(\mathrm{ED}^4) \right\}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord text"><span class="mord">QTL region</span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.8em;vertical-align:-0.65em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2">{</span></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord"><span class="mord mathrm">ED</span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8873em;"><span style="top:-3.1362em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">4</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord overline"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.0873em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathrm">ED</span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8873em;"><span style="top:-3.1362em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">4</span></span></span></span></span></span></span></span></span></span><span style="top:-4.0073em;"><span class="pstrut" style="height:3em;"></span><span class="overline-line" style="border-bottom-width:0.04em;"></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">3</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathrm">Var</span></span><span class="mopen">(</span><span class="mord"><span class="mord"><span class="mord mathrm">ED</span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8873em;"><span style="top:-3.1362em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">4</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2">}</span></span></span></span></span></span></span></p>
<p>📌 <strong>更新说明（2025-08-09）</strong><br>
发布 easyQTLseq v1.2.0，新增了以下功能：<br>
新增G’算法，<em>p</em>-value=0.01的G值作为阈值，超过该值的区域为显著 QTL。</p>
<p class="katex-block "><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mtext>QTL region</mtext><mo>=</mo><mrow><mo fence="true">{</mo><mi>x</mi><mtext> </mtext><mo fence="false" stretchy="true" minsize="1.2em" maxsize="1.2em">∣</mo><mtext> </mtext><msup><mi>G</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>&gt;</mo><msubsup><mi>G</mi><mn>0.01</mn><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\text{QTL region} = \left\{ x \,\big|\, G&#x27;(x) &gt; G&#x27;_{0.01} \right\}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord text"><span class="mord">QTL region</span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2em;vertical-align:-0.35em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">{</span></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="delimsizing mult"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.85em;"><span style="top:-2.85em;"><span class="pstrut" style="height:3.2em;"></span><span style="width:0.333em;height:1.200em;"><svg xmlns="http://www.w3.org/2000/svg" width='0.333em' height='1.200em' viewBox='0 0 333 1200'><path d='M145 15 v585 v0 v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v0 v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v0 v585 h43z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.35em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8019em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8019em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">0.01</span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">}</span></span></span></span></span></span></span></p>
<p>最新版本请访问：<a target="_blank" rel="noopener" href="https://github.com/laowang1992/easyQTLseq">easyQTLseq</a></p>
</blockquote>
<p>QTL-seq是一种结合混池分离分析（Bulked segregant analysis，BSA）和高通量测序的方法<sup id="fnref:1" class="footnote-ref"><a href="#fn:1" rel="footnote"><span class="hint--top hint--rounded" aria-label="[Takagi H, Abe A, Yoshida K, et al. QTL-seq: rapid mapping of quantitative trait loci in rice by whole genome resequencing of DNA from two bulked populations. Plant J. 2013;74(1):174-183. doi:10.1111/tpj.12105](https://doi.org/10.1111/tpj.12105)">[1]</span></a></sup>，这种方法对于质量性状 QTL 或数量性状主效 QTL 定位具有省时省力省钱的特点。我们在前面已经介绍过<a href="/2023/04/22/20230422-QTLseqMethod/">QTL-seq分析的原理</a>以及<a href="/2023/04/22/20230422-getQTLseqCI/">如何计算QTL-seq中的的置信区间</a>。这里我们介绍如何使用R包 <a target="_blank" rel="noopener" href="https://github.com/laowang1992/easyQTLseq.git">easyQTLseq</a> 进行 QTL-seq 分析。</p>
<p>easyQTLseq 包的一个优势是可以灵活处理有无亲本信息、有一个还是两个亲本信息以及亲本是否有参考基因等各种情况，并且可以导出各个计算过程的结果以及生成高质量的图片。</p>
<h2 id="安装easyQTLseq">安装easyQTLseq</h2>
<p>easyQTLseq 包在 GitHub 上，使用 <code>devtools</code> 包安装。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment"># install devtools</span><br>install.packages<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;devtools&quot;</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># install easyQTLseq</span><br>devtools<span class="hljs-operator">::</span>install_github<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;laowang1992/easyQTLseq&quot;</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h2 id="准备输入数据">准备输入数据</h2>
<h3 id="使用-GATK-VariantsToTable">使用 GATK VariantsToTable</h3>
<p>对亲本和混池的测序数据使用 GATK best practice pipeline 得到 VCF 文件，其中包含了各个样本的基因型（Genotype，GT）、基因型质量（Genotype Quality，GQ）、等位基因的深度（Allelic Depth，AD）以及一些其他的信息。为了加快数据读取和处理速度，使用 GATK 的 <code>VariantsToTable</code> 功能提取 CHROM、POS、REF、ALT 以及各个样本的 GT、GQ 和 AD 信息。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs shell">java -Xmx30g -jar $&#123;GATK&#125; \<br>     -R $&#123;genome&#125; -T VariantsToTable \<br>     -F CHROM -F POS -F REF -F ALT -GF GT -GF AD -GF GQ \<br>     -V $&#123;BSA&#125;.filter.SNPs.vcf.gz -o $&#123;BSA&#125;.filter.SNPs.table<br></code></pre></td></tr></table></figure>
<h3 id="使用-vcf2table">使用 vcf2table</h3>
<p>如果说你只有一个 VCF 文件，而且没有装 GATK，那如何做格式转换呢？<code>easyQTLseq</code> 包提供了一个函数 <code>vcf2table()</code> 用于格式转换。可以先用 <code>vcfR</code> 包中的 <code>read.vcfR()</code> 函数读取 VCF，然后用 <code>vcf2table()</code> 转换，函数输出可以直接用于 <code>select_sample_and_SNP()</code>。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs R">library<span class="hljs-punctuation">(</span>vcfR<span class="hljs-punctuation">)</span><br>library<span class="hljs-punctuation">(</span>easyQTLseq<span class="hljs-punctuation">)</span><br>file_path <span class="hljs-operator">&lt;-</span> system.file<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;extdata&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;A07.SNPs.vcf.gz&quot;</span><span class="hljs-punctuation">,</span> package <span class="hljs-operator">=</span> <span class="hljs-string">&quot;easyQTLseq&quot;</span><span class="hljs-punctuation">)</span><br>x <span class="hljs-operator">&lt;-</span> read.vcfR<span class="hljs-punctuation">(</span>file <span class="hljs-operator">=</span> file_path<span class="hljs-punctuation">)</span><br>data <span class="hljs-operator">&lt;-</span> vcf2table<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x<span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h3 id="数据来源">数据来源</h3>
<p>这里我们使用的数据来源于一篇甘蓝型油菜花色研究的文章<sup id="fnref:2" class="footnote-ref"><a href="#fn:2" rel="footnote"><span class="hint--top hint--rounded" aria-label="[Ye S, Hua S, Ma T, et al. Genetic and multi-omics analyses reveal BnaA07.PAP2In-184-317 as the key gene conferring anthocyanin-based color in Brassica napus flowers. J Exp Bot. 2022;73(19):6630-6645. doi:10.1093/jxb/erac312](https://doi.org/10.1093/jxb/erac312)">[2]</span></a></sup>（注意：样本命名和原文不同）。这篇文章使用两个 F<sub>2</sub> 群体将花色 QTL 定位到 A07 染色体的 21.96-30.14Mb 区间上，最终经过精细定位得到候选基因 <em>BnaA07.PAP2</em> (<em>BnaA07G0287000ZS</em>) 的位置是 A07:26,522,430-26,524,093。</p>
<p><img src="./article.jpg" srcset="/img/loading.gif" lazyload alt="甘蓝型油菜花色表型和QTL定位" title="甘蓝型油菜花色表型和QTL定位 Ye et al. 2022"></p>
<h2 id="使用方法">使用方法</h2>
<h3 id="加载包并导入数据">加载包并导入数据</h3>
<p>使用 <code>VariantsToTable</code> 准备好数据文件并加载 easyQTLseq 包后就可以导入数据了。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs R">library<span class="hljs-punctuation">(</span>easyQTLseq<span class="hljs-punctuation">)</span><br>file_path <span class="hljs-operator">&lt;-</span> <span class="hljs-string">&quot;BSA.filter.SNPs.table&quot;</span><br><span class="hljs-comment"># readr::read_tsv() has a faster speed than read.table() when reading a file.</span><br>data <span class="hljs-operator">&lt;-</span> readr<span class="hljs-operator">::</span>read_tsv<span class="hljs-punctuation">(</span>file <span class="hljs-operator">=</span> file_path<span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<pre><code class="hljs">## Rows: 2803830 Columns: 16
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: &quot;\t&quot;
## chr (11): CHROM, REF, ALT, R.GT, R.AD, R3.GT, R3.AD, Y.GT, Y.AD, qY.GT, qY.AD
## dbl  (5): POS, R.GQ, R3.GQ, Y.GQ, qY.GQ
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
</code></pre>
<h3 id="指定样本信息并筛选SNP位点">指定样本信息并筛选SNP位点</h3>
<p>读取数据后，使用 <code>select_sample_and_SNP()</code> 函数对数据进行初步处理。选择亲本和混池并指定对应的材料信息，并指定群体类型和混池样本数量等信息，其他参数参考帮助信息。这个函数最终会返回一个包含所有信息的 QTLseq S3 对象。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs R">x <span class="hljs-operator">&lt;-</span> select_sample_and_SNP<span class="hljs-punctuation">(</span>data <span class="hljs-operator">=</span> data<span class="hljs-punctuation">,</span> <br>                           highP <span class="hljs-operator">=</span> <span class="hljs-string">&quot;qY&quot;</span><span class="hljs-punctuation">,</span>        <span class="hljs-comment"># 高表型亲本名称</span><br>                           lowP <span class="hljs-operator">=</span> <span class="hljs-string">&quot;R3&quot;</span><span class="hljs-punctuation">,</span>         <span class="hljs-comment"># 低表型亲本名称</span><br>                           highB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;Y&quot;</span><span class="hljs-punctuation">,</span>         <span class="hljs-comment"># 极端高表型混池名称</span><br>                           lowB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;R&quot;</span><span class="hljs-punctuation">,</span>          <span class="hljs-comment"># 极端低表型混池名称</span><br>                           popType <span class="hljs-operator">=</span> <span class="hljs-string">&quot;F2&quot;</span><span class="hljs-punctuation">,</span>      <span class="hljs-comment"># 群体类型，F2或者RIL。如果你的是DH群体也需要填RIL</span><br>                           bulkSize <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">30</span><span class="hljs-punctuation">,</span> <span class="hljs-number">30</span><span class="hljs-punctuation">)</span> <span class="hljs-comment"># 混池大小，也就是高表型池和低表型池中个体的数量</span><br>                           <span class="hljs-punctuation">)</span><br>x<br></code></pre></td></tr></table></figure>
<pre><code class="hljs">## $data
## # A tibble: 722,424 × 12
##    CHROM          POS REF   ALT   HP.DP LP.DP HB.HP.AD HB.LP.AD HB.DP LB.HP.AD
##    &lt;chr&gt;        &lt;dbl&gt; &lt;chr&gt; &lt;chr&gt; &lt;int&gt; &lt;int&gt;    &lt;int&gt;    &lt;int&gt; &lt;int&gt;    &lt;int&gt;
##  1 scaffoldA01 275959 A     C        17    24        6        6    12       16
##  2 scaffoldA01 320766 G     A        19    11        6        6    12       10
##  3 scaffoldA01 361230 A     T        18     6        6        5    11        8
##  4 scaffoldA01 361486 G     T        26     9       13        5    18        8
##  5 scaffoldA01 361875 A     C        19     5        8        0     8        4
##  6 scaffoldA01 361884 T     G        19     5        8        0     8        6
##  7 scaffoldA01 362128 A     C        19     6        7        5    12        4
##  8 scaffoldA01 362153 T     G        20     5        8        5    13        6
##  9 scaffoldA01 364170 C     T        17    14       12        9    21       14
## 10 scaffoldA01 365454 T     C        18    10       11        5    16       15
## # ℹ 722,414 more rows
## # ℹ 2 more variables: LB.LP.AD &lt;int&gt;, LB.DP &lt;int&gt;
## 
## $highP
## [1] &quot;qY&quot;
## 
## $lowP
## [1] &quot;R3&quot;
## 
## $highB
## [1] &quot;Y&quot;
## 
## $lowB
## [1] &quot;R&quot;
## 
## $popType
## [1] &quot;F2&quot;
## 
## $bulkSize
## [1] 30 30
## 
## $slidwin
## data frame with 0 columns and 0 rows
## 
## $chrLen
## # A tibble: 523 × 2
##    CHROM            Len
##    &lt;chr&gt;          &lt;dbl&gt;
##  1 scaffold0022   70801
##  2 scaffold0025 4039467
##  3 scaffold0026 8552783
##  4 scaffold0027 5993037
##  5 scaffold0032   11673
##  6 scaffold0034   36998
##  7 scaffold0036     262
##  8 scaffold0037   23809
##  9 scaffold0038   32054
## 10 scaffold0039    6403
## ℹ 513 more rows
## ℹ Use `print(n = ...)` to see more rows
## 
## attr(,&quot;class&quot;)
## [1] &quot;QTLseq&quot;     &quot;WithParent&quot; &quot;BothParent&quot;
</code></pre>
<p>除此之外，这个函数还可以处理各种不同的情况，例如上述的分离群体双亲都存在的情况、只有高表型亲本或低表型亲本存在的情况、没有亲本信息的情况、或者在 call SNP 时使用的是其中一个亲本的参考基因组。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment"># If only one parent is present, e.g. high parent.</span><br>x_onlyHP <span class="hljs-operator">&lt;-</span> select_sample_and_SNP<span class="hljs-punctuation">(</span>data <span class="hljs-operator">=</span> data<span class="hljs-punctuation">,</span> highP <span class="hljs-operator">=</span> <span class="hljs-string">&quot;qY&quot;</span><span class="hljs-punctuation">,</span> highB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;Y&quot;</span><span class="hljs-punctuation">,</span> lowB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;R&quot;</span><span class="hljs-punctuation">,</span> popType <span class="hljs-operator">=</span> <span class="hljs-string">&quot;F2&quot;</span><span class="hljs-punctuation">,</span> bulkSize <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">30</span><span class="hljs-punctuation">,</span> <span class="hljs-number">30</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># If no parent is present.</span><br>x_noParent <span class="hljs-operator">&lt;-</span> select_sample_and_SNP<span class="hljs-punctuation">(</span>data <span class="hljs-operator">=</span> data<span class="hljs-punctuation">,</span> highB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;Y&quot;</span><span class="hljs-punctuation">,</span> lowB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;R&quot;</span><span class="hljs-punctuation">,</span> popType <span class="hljs-operator">=</span> <span class="hljs-string">&quot;F2&quot;</span><span class="hljs-punctuation">,</span> bulkSize <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">30</span><span class="hljs-punctuation">,</span> <span class="hljs-number">30</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># If no parent is present, but high parent has a reference genome, this reference genome is used for SNP calling. Then the `highP` parameter should be &quot;REF&quot;.</span><br>x_HPisREF <span class="hljs-operator">&lt;-</span> select_sample_and_SNP<span class="hljs-punctuation">(</span>data <span class="hljs-operator">=</span> data<span class="hljs-punctuation">,</span> highP <span class="hljs-operator">=</span> <span class="hljs-string">&quot;REF&quot;</span><span class="hljs-punctuation">,</span> highB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;Y&quot;</span><span class="hljs-punctuation">,</span> lowB <span class="hljs-operator">=</span> <span class="hljs-string">&quot;R&quot;</span><span class="hljs-punctuation">,</span> popType <span class="hljs-operator">=</span> <span class="hljs-string">&quot;F2&quot;</span><span class="hljs-punctuation">,</span> bulkSize <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">30</span><span class="hljs-punctuation">,</span> <span class="hljs-number">30</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h3 id="统计覆盖深度分布密度">统计覆盖深度分布密度</h3>
<p>在选择样本和 SNP 位点后，我们统计了每个样本所有 SNP 位点覆盖深度的分布，这样可以为后面根据覆盖深度过滤 SNP 位点提供参考。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs R">depth_statistics<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x<span class="hljs-punctuation">,</span> <br>                 outPrefix <span class="hljs-operator">=</span> <span class="hljs-string">&quot;outprefix&quot;</span> <span class="hljs-comment"># &quot;outprefix&quot;是输出文件的前缀</span><br>                 <span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<p><img src="./outprefix.depth_density.png" srcset="/img/loading.gif" lazyload alt="覆盖深度分布密度" title="覆盖深度分布密度"></p>
<h3 id="根据覆盖深度过滤SNP位点">根据覆盖深度过滤SNP位点</h3>
<p>低覆盖深度 SNP 的可靠性和准确性较低，而极高覆盖深度的 SNP 位点可能来自重复序列。这些 SNP 在进行后续分析前应该排除。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment"># default minimum coverage depth is 6, default maximum coverage depth is `average+3*sd`.</span><br>x_filter <span class="hljs-operator">&lt;-</span> filterDP<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x<span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h3 id="统计SNP位点分布">统计SNP位点分布</h3>
<p>在经过上述处理后，剩下的 SNP 可以用于 QTL-seq 分析，在分析之前应当检查一下 SNP 位点沿染色体的分布情况。这个分析所使用的参考基因组有很多没有挂载到染色体的 scaffold 片段，这里使用 <code>targetChr</code> 指定只分析19条染色体上的分布，并且这个基因组的染色体命名是按照 scaffoldA01、scaffoldA02 … 这种格式，因此使用 <code>chrLabel</code> 重新指定染色体名称为 A01、A02 … 。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs R">targetChr <span class="hljs-operator">&lt;-</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span>paste0<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;scaffoldA&quot;</span><span class="hljs-punctuation">,</span> sprintf<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;%02d&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-operator">:</span><span class="hljs-number">10</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> paste0<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;scaffoldC&quot;</span><span class="hljs-punctuation">,</span> sprintf<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;%02d&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-operator">:</span><span class="hljs-number">9</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>chrLabel <span class="hljs-operator">&lt;-</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span>paste0<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;A&quot;</span><span class="hljs-punctuation">,</span> sprintf<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;%02d&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-operator">:</span><span class="hljs-number">10</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> paste0<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;C&quot;</span><span class="hljs-punctuation">,</span> sprintf<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;%02d&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-operator">:</span><span class="hljs-number">9</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>SNP_distribution<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x_filter<span class="hljs-punctuation">,</span> outPrefix <span class="hljs-operator">=</span> <span class="hljs-string">&quot;outprefix&quot;</span><span class="hljs-punctuation">,</span> <br>                 targetChr <span class="hljs-operator">=</span> targetChr<span class="hljs-punctuation">,</span> <span class="hljs-comment"># 这里的targetChr是一个向量。你所用的基因组中可能有很多scaffold或contig，而这个向量中包含了需要展示的染色体名称，如果不指定这个参数，那么默认展示数据集中所有的染色体</span><br>                 chrLabel <span class="hljs-operator">=</span> chrLabel    <span class="hljs-comment"># 指定展示的染色体的名称，默认是数据集中染色体的名称，和&quot;targetChr&quot;参数对应。例如这个例子中数据集中第一个染色体名称是&quot;scaffoldA01&quot;，通过这个参数可以修改为&quot;A01&quot;</span><br>                 <span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<!--![SNP沿染色体分布](./outprefix.SNP_distribution_histogram.png "SNP沿染色体分布")-->
<figure>
  <img src="/2023/11/07/20231107-easyQTLseq/outprefix.SNP_distribution_histogram.png" srcset="/img/loading.gif" lazyload alt="Image Alt Text" width="500px">
  <figcaption>SNP沿染色体分布</figcaption>
</figure>
<h3 id="导出等位基因覆盖深度数据">导出等位基因覆盖深度数据</h3>
<p>如果想使用其他软件或方法来进行 QTL-seq 分析，就可以使用 <code>export_dp()</code> 函数导出等位基因覆盖深度信息，这个函数将生成名为 <code>&lt;outprefix&gt;.Depth_information.txt|csv</code> 的文件。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs R">export_dp<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x_filter<span class="hljs-punctuation">,</span> outPrefix <span class="hljs-operator">=</span> <span class="hljs-string">&quot;outprefix&quot;</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h3 id="滑窗统计计算-ΔSNP-index-和-ED-值">滑窗统计计算 ΔSNP-index 和 ED 值</h3>
<p>为了减小噪音使结果更加平滑，这里只用滑窗统计的方法来计算 SNP index、ΔSNP index、欧几里得距离（Euclidean Distance, ED）。在这一步，如果存在至少一个亲本的信息或者 call SNP 使用的是其中一个亲本的参考基因组，则 ΔSNP index 和 ED 值可以同时计算，如果没有亲本信息，则只计算 ED 值。同时这一步也会自动在当前目录导出滑窗统计的结果。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs R">x_filter <span class="hljs-operator">&lt;-</span> calc_index_etc<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x_filter<span class="hljs-punctuation">,</span> outPrefix <span class="hljs-operator">=</span> <span class="hljs-string">&quot;outprefix&quot;</span><span class="hljs-punctuation">,</span> <br>                           winSize <span class="hljs-operator">=</span> <span class="hljs-number">2000000</span><span class="hljs-punctuation">,</span>   <span class="hljs-comment"># 滑窗统计的窗口大小</span><br>                           winStep <span class="hljs-operator">=</span> <span class="hljs-number">200000</span>      <span class="hljs-comment"># 滑窗统计的步长</span><br>                           <span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h3 id="导出图片">导出图片</h3>
<p>前面使用滑窗统计计算出结果，这一步则将上述计算结果按照染色体位置绘制图片并导出。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs R">export_figure<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x_filter<span class="hljs-punctuation">,</span> <br>              outPrefix <span class="hljs-operator">=</span> <span class="hljs-string">&quot;outprefix&quot;</span><span class="hljs-punctuation">,</span> <br>              targetChr <span class="hljs-operator">=</span> targetChr<span class="hljs-punctuation">,</span>   <span class="hljs-comment"># Target chromosome to be drawn in figures, default is all chromosomes in the data.</span><br>              chrLabel <span class="hljs-operator">=</span> chrLabel<span class="hljs-punctuation">,</span>     <span class="hljs-comment"># The label for chromosome shown in figures, default is chromosome names in the data.</span><br>              minN <span class="hljs-operator">=</span> <span class="hljs-number">20</span><span class="hljs-punctuation">,</span>               <span class="hljs-comment"># Too few SNPs in a window will result in noise, the windows containing SNPs less than minN will be omitted in figures.</span><br>              width <span class="hljs-operator">=</span> <span class="hljs-number">12</span><span class="hljs-punctuation">,</span> height <span class="hljs-operator">=</span> <span class="hljs-number">4</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<p><img src="/img/index_banner/qtlseq.png" srcset="/img/loading.gif" lazyload alt="delta SNP index" title="delta SNP index"></p>
<h3 id="获取QTL信息">获取QTL信息</h3>
<p>现在图表结果都有了，那么 QTL 位点的具体位置是哪里呢？如何得到QTL所在染色体的放大图片呢？这里可以使用 <code>getQTL_and_exportFigure() </code>来获得这些信息和结果。这个函数会将QTL在染色体上的位置区间、峰值所在位置、峰值 ΔSNP index 等信息导入名为 <code>&lt;outprefix&gt;.99|95CI.csv</code> 的表格中，并导出目标染色体的图片。当然和前面一样如果没有亲本信息，那么这一步就可以省略了。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs R">getQTL_and_exportFigure<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> x_filter<span class="hljs-punctuation">,</span> outPrefix <span class="hljs-operator">=</span> <span class="hljs-string">&quot;outprefix&quot;</span><span class="hljs-punctuation">,</span> minN <span class="hljs-operator">=</span> <span class="hljs-number">20</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<!--![A07 染色体](./outprefix.scaffoldA07.99CI.png "A07 染色体")-->
<figure>
  <img src="/2023/11/07/20231107-easyQTLseq/outprefix.scaffoldA07.99CI.png" srcset="/img/loading.gif" lazyload alt="Image Alt Text" width="450px">
  <figcaption>A07 染色体</figcaption>
</figure>
<p>到这里整个 QTL-seq 分析就结束了，在99%的置信区间下鉴定到一个 QTL 位于 A07:22,280,000-29,840,000，与文章结果基本相同，峰值所在位置为 25,740,000 bp，与候选基因 <em>BnaA07.PAP2</em> 的位置较为吻合。运行过程所产生的各种图表结果会自动导出，并且以 <code>outPrefix</code> 前缀命名。这个包的作者起名叫 <code>easyQTLseq</code>，主要是它可以自动处理有无亲本、亲本是否有参考基因组的各种情况，并且可以自动导出各种图表结果。但是很显然整个分析过程还是需要很多步骤才能完成，并且使用者至少需要了解R语言编程才能使用，并没有达到作者所说的 <strong>easy</strong> 的程度，因此后续可以结合 shiny 为这个扩展包写个图形界面，将各个参数设置好以后点击 <code>run</code> 可以直接运行所有步骤并生成所有结果，这种程度才算是真正的 <strong>easyQTLseq</strong> 。</p>
<h2 id="引用">引用</h2>
<p>如果使用 easyQTLseq 进行 QTL-seq 分析，在撰写文章时可以在 <strong>Method</strong> 部分注明：</p>
<blockquote>
<p>The QTL-seq analysis was performed using R package easyQTLseq (<a target="_blank" rel="noopener" href="https://github.com/laowang1992/easyQTLseq.git">https://github.com/laowang1992/easyQTLseq.git</a>).</p>
</blockquote>
<hr>
<p><img src="https://images.pexels.com/photos/20692988/pexels-photo-20692988.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=600&amp;lazy=load" srcset="/img/loading.gif" lazyload alt="图片与主题无关" title="图片与主题无关"></p>
<p class="note note-primary">参考文献</p>
<section class="footnotes"><div class="footnote-list"><ol><li><span id="fn:1" class="footnote-text"><span><a target="_blank" rel="noopener" href="https://doi.org/10.1111/tpj.12105">Takagi H, Abe A, Yoshida K, et al. QTL-seq: rapid mapping of quantitative trait loci in rice by whole genome resequencing of DNA from two bulked populations. Plant J. 2013;74(1):174-183. doi:10.1111/tpj.12105</a>
<a href="#fnref:1" rev="footnote" class="footnote-backref"> ↩</a></span></span></li><li><span id="fn:2" class="footnote-text"><span><a target="_blank" rel="noopener" href="https://doi.org/10.1093/jxb/erac312">Ye S, Hua S, Ma T, et al. Genetic and multi-omics analyses reveal BnaA07.PAP2In-184-317 as the key gene conferring anthocyanin-based color in Brassica napus flowers. J Exp Bot. 2022;73(19):6630-6645. doi:10.1093/jxb/erac312</a>
<a href="#fnref:2" rev="footnote" class="footnote-backref"> ↩</a></span></span></li></ol></div></section>
                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" class="category-chain-item">技术分享</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/R/">#R</a>
      
        <a href="/tags/QTL-seq/">#QTL-seq</a>
      
        <a href="/tags/BSA/">#BSA</a>
      
        <a href="/tags/easyQTLseq/">#easyQTLseq</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>QTL-seq系列 | 使用easyQTLseq进行QTL-seq分析</div>
      <div>https://laowang2023.cn/2023/11/07/20231107-easyQTLseq/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>老王</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年11月7日</div>
        </div>
      
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2023/12/22/20231222-JinYongChronicles/" title="金庸武侠编年史">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">金庸武侠编年史</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2023/10/03/20231003-Xiaoyun/" title="Plant Commun. | 甘蓝型油菜功能基因组学研究的模式材料-小芸">
                        <span class="hidden-mobile">Plant Commun. | 甘蓝型油菜功能基因组学研究的模式材料-小芸</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments" lazyload>
      
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"81Ynz10f9eqlTLw0V6ue4tBu-gzGzoHsz","appKey":"4Mxe0RlrV6wJ0n9C6ZDpYI6O","path":"window.location.pathname","placeholder":"你是不是想说点什么","avatar":"identicon","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":true,"serverURLs":"https://81ynz10f.lc-cn-n1-shared.com","emojiCDN":null,"emojiMaps":null,"enableQQ":true},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  


  
  








    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="leancloud-site-pv-container" style="display: none">
        总访问量 
        <span id="leancloud-site-pv"></span>
         次
      </span>
    
    
      <span id="leancloud-site-uv-container" style="display: none">
        总访客数 
        <span id="leancloud-site-uv"></span>
         人
      </span>
    
    

  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script defer src="/js/leancloud.js" ></script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
